package com.da.javatest.leetCode;

import java.util.Arrays;

/**
 * @author chenlida
 * @date 2019/1/17 10:59
 * @description
 */
public class Code164 {
    public int maximumGap(int[] nums) {
        if (nums.length < 2) { return 0; }
        int max = 0;
        Arrays.sort(nums);
        for (int i = 1; i < nums.length; i++) {
            max = Math.max(max, nums[i] - nums[i - 1]);
        }
        return max;
    }
}
